cmake_minimum_required(VERSION 3.25)
project(xbench VERSION 0.1 LANGUAGES CXX)

set(ENABLE_TEST on)

set(CMAKE_CXX_STANDARD 20)
set(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/lib")

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
    add_link_options("/O1")
    add_link_options("/Wall")
else()
    add_link_options("-O1")
    add_link_options("-Wall")
endif()

include_directories("include")

add_subdirectory(src)

message(STATUS "CMake - OS:         ${CMAKE_HOST_SYSTEM_NAME}")
message(STATUS "CMake - Compiler:   ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION})")
message(STATUS "CMake - Version:    ${CMAKE_VERSION}")
message(STATUS "")

if(${ENABLE_TEST})
    message(STATUS "Test ON")

    enable_testing()
    add_subdirectory("test")
else()
    message(STATUS "Test OFF")
endif()

